import random  # 导入随机数的模块 random
all_choices = ["石头", "剪刀", "布"]  # 存储出拳的每个选择
# 随机选出一个元素，随机出来的元素为电脑的出拳
computer = random.choice(all_choices)
print("computer:", computer)
# 获取用户的出拳选择
player = input("请出拳(石头/剪刀/布):")
if player == computer:
    print("平局")
elif player == "石头":
    if computer == "剪刀":
        print("player win~")
    else:
        print("computer win~")
elif player == "剪刀":
    if computer == "石头":
        print("computer win~")
    else:
        print("player win~")
else: # player: 布
    if computer == "剪刀":
        print("computer win~")
    else:
        print("player win~")
